package com.boot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

/**
 * @author: zcs
 * @data: 2021/4/15
 * @description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_permission")
public class Permission implements GrantedAuthority {

    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField("code")
    private String code;
    @TableField("url")
    private String url;
    @TableField("desc")
    private String desc;

    @Override
    public String getAuthority() {
        return this.code;
    }
}